<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- 拿到项目的根路径  放入到域对象中 。 -->
<c:set var="root" value="${pageContext.request.contextPath }" />


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>网上商城管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="${root }/css/general.css" rel="stylesheet" type="text/css" />
<link href="${root }/css/main.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
<script src="js/jquery.validate.min.js" type="text/javascript"></script>
<style type="text/css">
body {
	color: white;
}
</style>
<script type="text/javascript">
$(function(){
		$("form").validate({
			rules:{
				"username":{
					"required":true
				},
				"password":{
					"required":true
				}
			},
			messages:{
				"username":{
					"required":"用户名不能为空",
				},
				"password":{
					"required":"密码不能为空",
				}
			}
		}); 
</script>
</head>
<body style="background: #278296">
	<center></center>
	<form method="post" action="${root }/AdminProductServlet?state=adminLogin"
		target="_parent" name='theForm' onsubmit="return validate()">
		<table cellspacing="0" cellpadding="0" style="margin-top: 100px"
			align="center">
			<tr>
				<td style="padding-left: 50px">
					<table>
						<tr>
							<td>管理员姓名：</td>
							<td><input type="text" name="username" /></td>
						</tr>
						<tr>
							<td>管理员密码：</td>
							<td><input type="password" name="password" /></td>
						</tr>
						<tr>
							<td><font color="red">${msg}</font></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td><input type="submit" value="进入管理中心" class="button" /></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</form>
	<script language="JavaScript">
	<!--
		document.forms['theForm'].elements['username'].focus();

		/**
		 * 检查表单输入的内容
		 */
		function validate() {
			var validator = new Validator('theForm');
			validator.required('username', user_name_empty);
			//validator.required('password', password_empty);
			if (document.forms['theForm'].elements['captcha']) {
				validator.required('captcha', captcha_empty);
			}
			return validator.passed();
		}
	//-->
	</script>
</body>